<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <jsp:include page="/inc/head.jsp"/>
    <link rel="stylesheet" href="<%=request.getContextPath()%>/static/kindeditor/themes/default/default.css">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/static/datetimepicker-master/jquery.datetimepicker.min.css">
    <script src="<%=request.getContextPath()%>/static/datetimepicker-master/jquery.datetimepicker.full.min.js"></script>
    <script src="<%=request.getContextPath()%>/static/kindeditor/kindeditor-all-min.js"></script>
    <script>
        window.onload = function() {
            $.datetimepicker.setLocale('zh');//设置为中文
            let rd = $('#releaseDate').datetimepicker({
                value:new Date(),
                format:'Y-m-d H:i:s',
                maxDate:new Date()
            });
        }
        KindEditor.ready(function(K) {
            var editor1 = K.create('textarea[name="content"]', {
            });
        });
    </script>
    <title>文章管理</title>
</head>
<body>
<jsp:include page="/inc/top.jsp"/>
<div class="container">
    <jsp:include page="inc.jsp"/>
    <h3 style="text-align: center">文章添加</h3>
    <hr>
    <form action="<%=request.getContextPath()%>/admin/topic?m=addAction" method="post" class="form-horizontal">
        <div class="form-group">
            <label class="col-sm-2 control-label">标题:</label>
            <div class="col-sm-6">
                <input type="text" class="form-control" name="title" placeholder="输入标题">
            </div>
        </div>
        <div class="form-group">
            <label  class="col-sm-2 control-label">所属栏目:</label>
            <div class="col-sm-6">
                <select class="form-control" name="cid">
                    <c:forEach var="c" items="${cs}">
                        <option value="${c.id}">${c.name}</option>
                    </c:forEach>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label  class="col-sm-2 control-label">发布日期:</label>
            <div class="col-sm-6">
                <input id="releaseDate" type="text" class="form-control" name="releaseDate" placeholder="发布日期">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">文章内容:</label>
            <div class="col-sm-10">
                <textarea name="content" rows="10" cols="120"></textarea>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-default">添加文章</button>
                <button type="reset" class="btn btn-default">重置信息</button>
            </div>
        </div>
    </form>
</div>
</body>
</html>
